<?php
Page::getInstance()->addScript(URL_BASE_JAVASCRIPT . '/table.js');
Page::getInstance()->addScript(URL_BASE_JAVASCRIPT . '/fields.js');
Page::getInstance()->addScript(URL_BASE_JAVASCRIPT . '/fields.new.js');
switch (__ACTION__) {
    case "TABLE_ADD" :
        $content = TableManager::getInstance()->addTable();
        Response::getInstance()->setContentType('text/xml');
        break;
    case 'TABLE_NEW':
        $content = TableManager::getInstance()->getEditTableView();
        break;
    case 'TABLE_UPDATE':
        $content = TableManager::getInstance()->updateTable();
        Response::getInstance()->setContentType('text/xml');
        break;
     case "TABLE_EDIT" :
        $content = TableManager::getInstance()->getEditTableView($_REQUEST['id']);
        break;
    case "TABLE_VIEW" :
        $content = TableManager::getInstance()->getViewTableView($_REQUEST['id']);
        break;
    case "FIELD_NEW" :
        $content = FieldManager::getInstance()->getEmptyFieldView();
        break;
    case "FIELD_ADD" :
        $content = FieldManager::getInstance()->addField();
        Response::getInstance()->setContentType('text/xml');
        break;
    case "FIELD_DELETE" :
        $content = FieldManager::getInstance()->deleteField();
        Response::getInstance()->setContentType('text/xml');
        break;
    case "FIELD_UPDATE" :
        $content = FieldManager::getInstance()->updateField();
        Response::getInstance()->setContentType('text/xml');
        break;
      
}
?>
